﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class Add : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            var title = TextBox1.Text;
            var content = TextBox2.Text;
            var author = TextBox3.Text;
            var remarks = TextBox4.Text;
            Dbhelper.AddOr(string.Format("insert into articles(title,content,author,remarks)values('{0}','{1}','{2}','{3}')",title,content,author,remarks));
            Label5.Text = "添加成功";
            Response.Redirect("Default.aspx");
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            Response.Redirect("Default.aspx");
        }
    }
}